/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ghanaroutes.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author User
 */
@Entity
@Table(name = "notifications")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Notifications.findAll", query = "SELECT n FROM Notifications n"),
    @NamedQuery(name = "Notifications.delAllForUser", query = "Delete FROM Notifications n WHERE n.generatedFor = :generatedFor"),
    @NamedQuery(name = "Notifications.findByNotificationId", query = "SELECT n FROM Notifications n WHERE n.notificationId = :notificationId"),
    @NamedQuery(name = "Notifications.findByGeneratedBy", query = "SELECT n FROM Notifications n WHERE n.generatedBy = :generatedBy"),
    @NamedQuery(name = "Notifications.findByGeneratedFor", query = "SELECT n FROM Notifications n WHERE n.generatedFor = :generatedFor"),
    @NamedQuery(name = "Notifications.findByNotificationType", query = "SELECT n FROM Notifications n WHERE n.notificationType = :notificationType"),
    @NamedQuery(name = "Notifications.findByNotificationStatus", query = "SELECT n FROM Notifications n WHERE n.notificationStatus = :notificationStatus"),
    @NamedQuery(name = "Notifications.findByMessage", query = "SELECT n FROM Notifications n WHERE n.message = :message"),
    @NamedQuery(name = "Notifications.findByNotificationDate", query = "SELECT n FROM Notifications n WHERE n.notificationDate = :notificationDate")})
public class Notifications implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "notificationId")
    private Integer notificationId;
    @Column(name = "generatedBy")
    private Integer generatedBy;
    @Column(name = "generatedFor")
    private Integer generatedFor;
    @Column(name = "notificationType")
    private Short notificationType;
    @Column(name = "notificationStatus")
    private Short notificationStatus;
    @Lob
    @Size(max = 65535)
    @Column(name = "dataString")
    private String dataString;
    @Size(max = 200)
    @Column(name = "message")
    private String message;
    @Basic(optional = false)
    @NotNull
    @Column(name = "notificationDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date notificationDate;

    public Notifications() {
    }

    public Notifications(Integer notificationId) {
        this.notificationId = notificationId;
    }

    public Notifications(Integer notificationId, Date notificationDate) {
        this.notificationId = notificationId;
        this.notificationDate = notificationDate;
    }

    public Integer getNotificationId() {
        return notificationId;
    }

    public void setNotificationId(Integer notificationId) {
        this.notificationId = notificationId;
    }

    public Integer getGeneratedBy() {
        return generatedBy;
    }

    public void setGeneratedBy(Integer generatedBy) {
        this.generatedBy = generatedBy;
    }

    public Integer getGeneratedFor() {
        return generatedFor;
    }

    public void setGeneratedFor(Integer generatedFor) {
        this.generatedFor = generatedFor;
    }

    public Short getNotificationType() {
        return notificationType;
    }

    public void setNotificationType(Short notificationType) {
        this.notificationType = notificationType;
    }

    public Short getNotificationStatus() {
        return notificationStatus;
    }

    public void setNotificationStatus(Short notificationStatus) {
        this.notificationStatus = notificationStatus;
    }

    public String geDataString() {
        return dataString;
    }

    public void setDataString(String data) {
        this.dataString = data;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Date getNotificationDate() {
        return notificationDate;
    }

    public void setNotificationDate(Date notificationDate) {
        this.notificationDate = notificationDate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (notificationId != null ? notificationId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Notifications)) {
            return false;
        }
        Notifications other = (Notifications) object;
        if ((this.notificationId == null && other.notificationId != null) || (this.notificationId != null && !this.notificationId.equals(other.notificationId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ghanaroutes.entities.Notifications[ notificationId=" + notificationId + " ]";
    }
    
}
